/* Copyright 2012 The Go Authors.  All rights reserved.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */
'use strict';

// Declare app level module which depends on filters, and services

angular.module('tour', ['ui', 'tour.services', 'tour.controllers', 'tour.directives', 'ng']).
  config(['$routeProvider', '$locationProvider', function($routeProvider,$locationProvider) {
    $routeProvider.
    	when('/', {redirectTo: '/module/welcome/0'}).
    	when('/list', {templateUrl: 'partials/list.html'}).
    	when('/module/:moduleId/:pageNumber', {templateUrl: 'partials/editor.html', controller: 'ModuleCtrl'}).
    	when('/module/:moduleId', {redirectTo: '/module/:moduleId/0'}).
    	otherwise({redirectTo: '/'});

  }]).
  value('ui.config', {
    codemirror: {
        mode: 'text/x-go',
        lineNumbers: true,
        matchBrackets: true,
        indentWithTabs: true,
        lineWrapping: true,
        indentUnit: 4,
		extraKeys: {
			"Shift-Enter": function() {
				// TODO: Can I call the controller directly?
				window.run();
			}
		}
    }
  });
